<#include "common/main.html">
<#macro bodyId>user-mg</#macro>
<#macro content>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ty-common-page">
    <h1 class="page-header">用户新增 / 修改
        <div class="btns">
            <a class="btn btn-primary" href="${rc.contextPath}/user/list">返回用户列表</a>
        </div>
    </h1>
    <div class="table-responsive"  id="userModal">
        <form class="form-horizontal ac-form J_acXHRForm" role="form" data-formData='{"id":"${user.id}", "loginName":"${user.loginName}", 
        "name":"${user.name}", "loginPwd":"${user.loginPwd}", "reloginPwd":"${user.loginPwd}", "arrRoleId":"${arrRoleId}"}'>
            <input type="hidden" class="ac-form-item" name="id" value="${user.id}"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">用户姓名：</label>
                <div class="col-sm-7">
                    <input type="mobile" class="form-control" name="name">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">账号：</label>
                <div class="col-sm-7">
                    <input type="mobile" class="form-control userName" required placeholder="5-14 位字母+数字组合" name="loginName">
                </div>
                <div class="col-sm-2 need-verify">
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">密码：</label>
                <div class="col-sm-7">
                    <input type="password" class="form-control password" required placeholder="6-14 位字母+数字组合" name="loginPwd">
                </div>
                <div class="col-sm-2 need-verify">
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">重复密码：</label>
                <div class="col-sm-7">
                    <input type="password" class="form-control re-password" required placeholder="6-14 位字母+数字组合" name="reloginPwd">
                </div>
                <div class="col-sm-2 need-verify">
                    <div class="tips"></div>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-sm-3 control-label">功能角色：</label>
                <div class="col-sm-9 offset-left-10">
                    <div class="wrap">
                    	<#list roleList as role>
                    		<label class="checkbox-inline">
                    			<input type="checkbox" value="${role.id}" class="actives-checkbox" name="arrRoleId">${role.name}
                    		</label>
                    	</#list>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-8">
                    <button type="submit" class="btn btn-success">确认</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    var config = {
        userCreate: "${rc.contextPath}/user/create",
        userUpdate: "${rc.contextPath}/user/update"
    }
</script>
</#macro>